Configure Port Lock

About this task

Configure port lock to administratively lock a port or ports to prevent other users from changing port parameters or modifying port action. You cannot modify a locked port until you unlock the port.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Enable port lock globally:

    portlock enable

  3. Log on to GigabitEthernet Interface Configuration mode:

    interface gigabitethernet {sub-port]][,...][slot/all][all]}

  4. Lock a port:

    lock port {sub-port]][,...][slot/all][all]} enable

Example

Switch:1> enable

Switch:1# configure terminal

Log on to GigabitEthernet Interface Configuration mode:

Switch:1(config)# interface GigabitEthernet 1/1

Unlock port 1/14:

Switch:1(config-if)# no lock port 1/14 enable

Variable Definitions

The following table defines parameters for the interface gigabitethernet and lock port commands.

Variable

Value

{slot/port[/sub-port][-slot/port[/sub-port]][,...][slot/all][all]}

Identifies the slot and port in one of the following formats:
  • a single slot and port (slot/port)

  • a range of slots and ports (slot/port-slot/port)

  • a series of slots and ports (slot/port,slot/port,slot/port)

  • all ports on the same slot (slot/all)

  • all ports on the switch (all)

If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

For the lock port command, use the no form of this command to unlock a port: no lock port {slot/port[/sub-port][-slot/port[/sub-port]][,...]}